package com.spzx.product.service.impl;

import com.spzx.domain.Brand;
import com.spzx.product.mapper.BrandMapper;
import com.spzx.product.service.IBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 品牌Service业务层处理
 */
@Service
public class BrandServiceImpl implements IBrandService {
    @Autowired
    private BrandMapper brandMapper;

    @Override
    public int addBrand(Brand brand) {
        int rows = brandMapper.addBrand(brand);
        return rows;
    }

    @Override
    public int update(Brand brand) {
        return brandMapper.updateBrand(brand);
    }

    @Override
    public Brand getBrand(Long id) {
        Brand brand = brandMapper.getBrand(id);
        return brand;
    }

    @Override
    public List<Brand> selectBrandAll() {
        return brandMapper.selectBrandList(null);
    }

    @Override
    public int deleteBrandByIds(Long[] ids) {
        return brandMapper.deleteBrandByIds(ids);
    }

}
